/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-12-19 16:48:07
 */
const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

// 菜单路由
const menuRoutes = [
  {
    path: '/potenCus',
    meta: { title: '客户管理', icon: 'el-icon-s-tools' },
    redirect: '/potenCus/basedata',
    component: RouteView,
    children: [
      {
        path: '/potenCus/basedata',
        meta: { title: '业务参数定义' },
        redirect: '/potenCus/basedata/onceDriveMileage/index',
        component: RouteView,
        children: [
          {
            path: '/potenCus/basedata/onceDriveMileage/index',
            meta: { title: '单次试驾里程设置', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/onceDriveMileage/index')
          },
          {
            path: '/potenCus/basedata/informationChannel/index',
            meta: { title: '渠道细分定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/informationChannel/index')
          },
          {
            path: '/potenCus/basedata/industryCategory/index',
            meta: { title: ' 行业小类定义 ', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/industryCategory/index')
          },
          {
            path: '/potenCus/basedata/carBuyingFactor/index',
            meta: { title: ' 购车因素定义 ', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/carBuyingFactor/index')
          },
          {
            path: '/potenCus/basedata/defeatreason/index',
            meta: { title: ' 战败原因定义 ', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/defeatreason/index')
          },
          {
            path: '/potenCus/basedata/failModel/index',
            meta: { title: ' 战败车型定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/failModel/index')
          },
          {
            path: '/potenCus/basedata/followTask/index',
            meta: { title: ' 跟进规则定义 ', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/followTask/index')
          },
          {
            path: '/potenCus/basedata/followWays/index',
            meta: { title: ' 跟进方式定义 ', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/followWays/index')
          },
          {
            path: '/potenCus/basedata/searchTestDriveCars/index',
            meta: { title: '试驾车管理', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/searchTestDriveCars/index')
          },
          {
            path: '/potenCus/basedata/searchTestDriveWay/index',
            meta: { title: '试乘试驾路线定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/searchTestDriveWay/index')
          },
          {
            path: '/potenCus/basedata/driveCancel/index',
            meta: { title: '试驾取消原因定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/driveCancel/index')
          },
          {
            path: '/potenCus/basedata/cluesPrameter',
            meta: { title: '下发分配设置', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/cluesPrameter/index')
          },
          {
            path: '/potenCus/basedata/cueSourceDefinition/index',
            meta: { title: '来源渠道定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/cueSourceDefinition/index')
          },
          {
            path: '/potenCus/basedata/causesInvalidity/index',
            meta: { title: '无效原因定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/causesInvalidity/index')
          },
          {
            path: '/potenCus/basedata/competitiveModels/index',
            meta: { title: '竞品车型定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/competitiveModels/index')
          },
          {
            path: '/potenCus/basedata/forcedCleanTask/index',
            meta: { title: '强制清洗任务定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/forcedCleanTask/index')
          },

          {
            path: '/potenCus/basedata/clueParameters/index',
            meta: { title: '线索参数定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/clueParameters/index')
          },
          {
            path: '/potenCus/basedata/clueFever/index',
            meta: { title: '线索热度定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/clueFever/index')
          },
          {
            path: '/potenCus/basedata/dealerBlacklist/index',
            meta: { title: '经销商黑名单', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/dealerBlacklist/index')
          },
          {
            path: '/potenCus/basedata/custTask/index',
            meta: { title: '基盘任务定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/custTaskOEM/index')
          },
          {
            path: '/potenCus/basedata/knowWays/index',
            meta: { title: '了解途径', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/knowWays/index')
          },
          {
            path: '/potenCus/basedata/salesGroupSet/index',
            meta: { title: '销售组设置', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/salesGroupSet/index')
          },
          {
            path: '/potenCus/basedata/clueDistributeConfig/index',
            meta: { title: '线索分配规则定义', keepAlive: true },
            component: AsyncComponent('potenCus/basedata/clueDistributeConfig/index')
          },
          {
            path: '/potenCus/customer/consultantWork/index',
            meta: { title: '线索分配人设置', keepAlive: true },
            component: AsyncComponent('potenCus/customer/consultantWork/index')
          }
        ]
      },
      {
        path: '/potenCus/customer',
        meta: { title: '客户管理' },
        redirect: '/potenCus/customer/customerFollowInfo/index',
        component: RouteView,
        children: [
          {
            path: '/potenCus/customer/customerFollowInfo/index',
            meta: { title: '跟进管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/customerFollowInfo/index')
          },
          {
            path: '/potenCus/customer/customerVisit/index',
            meta: { title: '销售回访', keepAlive: true },
            component: AsyncComponent('potenCus/customer/returnSales/index')
          },
          {
            path: '/potenCus/customer/exhibition/index',
            meta: { title: '展厅接待', keepAlive: true },
            component: AsyncComponent('potenCus/customer/exhibition/index')
          },
          {
            path: '/potenCus/customer/exhibitionPanel/index',
            meta: { title: '展厅面板', keepAlive: true },
            component: AsyncComponent('potenCus/customer/exhibitionPanel/index')
          },
          // {
          //   path: '/potenCus/customer/driveManagement/index',
          //   meta: { title: '试驾管理', keepAlive: true },
          //   component: AsyncComponent('potenCus/customer/driveManagement/index')
          // },
          {
            path: '/potenCus/customer/driveManagementBq/index',
            meta: { title: '试驾管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/driveManagementBq/index')
          },
          {
            path: '/potenCus/customer/potenCusManage/index',
            meta: { title: '客档管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/potenCusManage/index')
          },
          {
            path: '/potenCus/customer/potenCusManageOEM/index',
            meta: { title: '线索管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/potenCusManageOEM/index')
          },
          {
            path: '/potenCus/customer/clueReport/index',
            meta: { title: '线索报表', keepAlive: true },
            component: AsyncComponent('potenCus/customer/clueReport/index')
          },
          {
            path: '/origin/ad/tmadexposed/index',
            meta: { title: '广告漏出', keepAlive: true },
            component: AsyncComponent('origin/ad/tmadexposed/index')
          },
          {
            path: '/potenCus/customer/dealerClueReport/index',
            meta: { title: '各地区经销商线索报表', keepAlive: true },
            component: AsyncComponent('potenCus/customer/dealerClueReport/index')
          },
          {
            path: '/potenCus/customer/orderManage/index',
            meta: { title: '预约管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/orderManage/index')
          },
          {
            path: '/potenCus/customer/approval/index',
            meta: { title: '审批管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/approval/index')
          },
          {
            path: '/potenCus/customer/quotedprice/index',
            meta: { title: '报价管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/quotedprice/index')
          },
          {
            path: '/potenCus/customer/clueManage/index',
            meta: { title: '线索管理', keepAlive: true },
            component: AsyncComponent('potenCus/customer/cluesQuery/index')
          },
          {
            path: '/potenCus/customer/mergeCustomer/index',
            meta: { title: '客档合并', keepAlive: true },
            component: AsyncComponent('potenCus/customer/mergeCustomer/index')
          },
          {
            path: '/potenCus/customer/customerinfo/index',
            meta: { title: '客户信息', keepAlive: true },
            component: AsyncComponent('potenCus/customer/customerinfo/index')
          },
        ]
      },
      {
        path: '/potenCus/customer',
        meta: { title: '通话管理' },
        redirect: '/potenCus/customer',
        component: RouteView,
        children: [
          {
            path: '/potenCus/customer/extension/index',
            meta: { title: '分机号管理', keepAlive: true },
            component: AsyncComponent('potenCus/linephone/extension/index')
          }
        ]
      },
      {
        path: '/potenCus/basePlate',
        meta: { title: '基盘客户' },
        redirect: '/potenCus/basePlate/basePlateFail/index',
        component: RouteView,
        children: [
          {
            path: '/potenCus/basePlate/cust1/index',
            meta: { title: '基盘客户管理', keepAlive: true },
            component: AsyncComponent('potenCus/basePlate/cust1Manage/index')
          },
          {
            path: '/potenCus/basePlate/basePlateFail/index',
            meta: { title: '基盘失效审核', keepAlive: true },
            component: AsyncComponent('potenCus/basePlate/basePlateFail/index')
          },
          {
            path: '/potenCus/basePlate/basePlateFollow/index',
            meta: { title: '基盘任务跟进', keepAlive: true },
            component: AsyncComponent('potenCus/basePlate/basePlateFollow/index')
          },
        ]
      }
    ],
  },
  {
    path: '/community',
    meta: { title: '社群', icon: 'el-icon-mobile' },
    redirect: '/community/management',
    component: RouteView,
    children: [
      {
        path: '/community/management',
        meta: { title: '社群管理' },
        redirect: '/community/management/news/index',
        component: RouteView,
        children: [
          {
            path: '/community/management/news/index',
            meta: { title: '资讯管理', keepAlive: true },
            component: AsyncComponent('community/management/news/index')
          },
          {
            path: '/community/management/activity/index',
            meta: { title: '活动管理', keepAlive: true },
            component: AsyncComponent('community/management/activity/index')
          },
          {
            path: '/community/management/posters/index',
            meta: { title: '海报管理', keepAlive: true },
            component: AsyncComponent('community/management/posters/index')
          },
        ]
      }
    ],

  }
];

export default menuRoutes;
